<!--
    提问管理详情
    梁
    2019年5月14日
    -->
<template lang="pug">
  kalix-master
    div.box
      div.boxLeft
        UserUnit
        Personage
      div.boxRight
        h1 提问管理
        div.center
          div.ulTitle
            template.eltemplate
              el-table(:data="tableData.slice((currentPage-1)*pagesize,currentPage*pagesize)"
              stripe
              style="width: 100%"
              :default-sort = "{prop: 'date', order: 'descending'}"
              ).el-table
                el-table-column(label="序号" width="170")
                  template(slot-scope="scope")
                    div(style="text-align: center") {{ scope.$index + 1 }}
                el-table-column(prop="issue" label="问题" width="170")
                el-table-column(prop="username" label="提问人" width="170")
                el-table-column(prop="name" label="答案人" width="170")
                el-table-column(prop="classHour" label="回答情况" width="170")
          div.paging
            el-pagination(
            @size-change="handleSizeChange"
            @current-change="current_change"
            :current-page.sync="currentPage"
            :page-size="100"
            layout="prev, pager, next, total, jumper"
            :total="total")
    div.clearfix
</template>

<script type="text/ecmascript-6">
  export default {
    name: 'QuizMeSon',
    data() {
      return {
        total: 500, // 默认数据总数
        pagesize: 10, // 每页的数据条数
        currentPage: 1, // 默认开始页面
        tableData: [
          {
            date: 0,
            issue: '上饶事件怎么看',
            name: '托尼',
            classHour: '正确',
            username: '智老师'
          },
          {
            date: 0,
            issue: '上饶事件怎么看',
            name: '托尼',
            classHour: '正确',
            username: '智老师'
          },
          {
            date: 0,
            issue: '上饶事件怎么看',
            name: '托尼',
            classHour: '正确',
            username: '智老师'
          },
          {
            date: 0,
            issue: '上饶事件怎么看',
            name: '托尼',
            classHour: '正确',
            username: '智老师'
          },
          {
            date: 0,
            issue: '上饶事件怎么看',
            name: '托尼',
            classHour: '正确',
            username: '智老师'
          },
          {
            date: 0,
            issue: '上饶事件怎么看',
            name: '托尼',
            classHour: '正确',
            username: '智老师'
          },
          {
            date: 0,
            issue: '上饶事件怎么看',
            name: '托尼',
            classHour: '正确',
            username: '智老师'
          },
          {
            date: 0,
            issue: '上饶事件怎么看',
            name: '托尼',
            classHour: '正确',
            username: '智老师'
          },
          {
            date: 0,
            issue: '上饶事件怎么看',
            name: '前端技术',
            classHour: '正确',
            username: '智老师'
          },
          {
            date: 0,
            issue: '上饶事件怎么看',
            name: '托尼',
            classHour: '正确',
            username: '智老师'
          }
        ],
        quiz: null
      }
    },
    mounted() {
      this.quiz = this.$route.params.name
      console.log('this.quiz', this.quiz)
    },
    methods: {
      handleSizeChange(val) {
        console.log(`每页 ${val} 条`)
      },
      current_change: function (currentPage) {
        this.currentPage = currentPage
      }
    },
    computed: {
      maxCredits: function () {
        let sun = 0
        this.tableData.forEach(item => {
          sun += item.credits * 1
        })
        return sun
      }
    }
  }
</script>

<style scoped lang="stylus" rel="stylesheet/stylus">
  .clearfix::after
    content ""
    clear both
    display block
    overflow hidden
    font-size 0
    height 0

  .box
    width 1200px
    margin 5px auto

  h1
    font-size 20px
    color #FF9933
    margin-bottom 36px

  .centerText
    color #FF9933
    display inline-block

  .center
    height 620px
    position relative

  .paging
    position absolute
    left 50%
    bottom 10px
    margin-left -355px

  .boxLeft
    width 247px
    height 1471px
    float left

  .boxRight
    width 926px
    height 1471px
    border 1px solid #ccc
    border-radius 5px
    float right
    padding 20px 20px 0 24px
    box-sizing border-box

  .boxLeftBottom
    width 247px
    height 1140px
    .personage
      display block
      width 247px
      height 60px
      line-height 60px
      text-align center
      border 1px solid #ccc
      background-color #F2F2F2
      cursor pointer
      position relative
      -o-user-select none /*文字禁止被选中*/
      -moz-user-select none /*火狐 firefox*/
      -webkit-user-select none /*webkit浏览器*/
      -ms-user-select none /*IE10+*/
      -khtml-user-select none /*早期的浏览器*/
      user-select none
      .icon
        position absolute
        width 20px
        height 20px
        top 1px
        left 56px
        font-size 22px
        color #333333
    .listBorder
      border none
      border-left 4px solid #FF9933
      background-color #fff
      span
        color #FF9933 !important
    .text
      color #666666
      font-size 18px

</style>
<style lang="stylus" rel="stylesheet/stylus">
  .ulTitle .el-table .cell
    text-align center
</style>
